package org.pp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Map;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 具体商品sku
 * </p>
 *
 * @author haima
 * @since 2024-06-09
 */
@Getter
@Setter
@TableName(value = "pp_goods_sku",autoResultMap = true)
@Schema(name = "PpGoodsSku", description = "具体商品sku")
public class PpGoodsSku implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "sku的id")
    @TableId(value = "sku_id", type = IdType.AUTO)
    private Long skuId;

    @Schema(description = "商品id")
    private Long goodsId;

    @Schema(description = "库存")
    private Integer stock;

    @Schema(description = "sku封面图")
    private String cover;

    @Schema(description = "sku封面图")
    @TableField(exist = false)
    private String coverUrl;

    @Schema(description = "原价")
    private BigDecimal originPrice;

    @Schema(description = "售价")
    private BigDecimal price;

    @Schema(description = "销量")
    private Integer sales;

    //@Schema(description = "参数。尺寸size，重量weight，其他的自己添加")
    //private String param;

    @Schema(description = "选择的属性值")
    //尺寸 为 大号
    //{"尺寸":"大号"}
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String,String> attrInfo;

    @TableField(exist = false)
    @Schema(description = "选择的属性值拼接")
    private String attrInfoStr;


    @Schema(description = "商品名称")
    private String name;

    @Schema(description = "租户号")
    private Long tenantId;

    @Schema(description = "乐观锁")
    private Integer revision;

    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;

    @Schema(description = "逻辑删除 1为删除 0为正常")
    private Boolean deleted;
}
